import { defineConfig } from 'vite'
import path from 'path'
import createVitePlugins from './vite/plugins'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    createVitePlugins(),
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
    extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://12306.magestack.cn',
        changeOrigin: true,
      },
    },
  },
})
